﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using DBUtility;
using CommonFunc;

public partial class Control_GBook1 : System.Web.UI.UserControl
{
    AutoPage AP = new AutoPage();

    protected void Page_Load(object sender, EventArgs e)
    {
        ControlDataInit();
    }

    #region ControlDataInit
    protected void ControlDataInit()
    {
        try
        {
            string SQLstr = "SELECT * FROM [GBook] WHERE [GBook_State]=True ORDER BY [GBook_DateTime] DESC";

            DataTable DT_GBook = AccHelper.GetDataTable(SQLstr);

            AP.AutoPageInit(DL_GBookList, DT_GBook, 5, LBtn_FirstPage, LBtn_PrePage, LBtn_NextPage,
                LBtn_LastPage, LB_PageIndex, LB_PageCount);

            if (!IsPostBack)
            {
                AP.DLAutoPage(0);
            }
        }
        catch (Exception ex)
        {
            LB_GBook.Text = ex.Message;
        }
    }
    #endregion
}
